
package com.joysuch.wwyt.bp.enums;

public enum DeviceFacilityTypes {

    SHENG_CHAN_ZHUANG_ZHI(1, "SCZZ", "生产装置"),
    GONG_YE_GUAN_DAO(2, "GYGD", "工业管道"),
    KU_QU(3, "KQ", "库区"),
    KU_FANG(4, "KF", "库房"),
    CHU_GUAN_QU(5, "CGQ", "储罐区"),
    CHU_GUAN(6, "CG", "储罐"),
    GONG_YI_LIU_CHENG(7, "GYLC", "工艺流程");

    private long id;
    private String code;
    private String name;

    private DeviceFacilityTypes(long id, String code, String name) {
        this.id = id;
        this.name = name;
        this.code = code;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static DeviceFacilityTypes findByName(String name) {
        DeviceFacilityTypes[] values = DeviceFacilityTypes.values();
        for (DeviceFacilityTypes v : values) {
            if (v.getName().equals(name)) {
                return v;
            }
        }
        return null;
    }
}
